package com.xuesi.demoadmin.service.impl;

import java.util.List;

import com.xuesi.demoadmin.entity.Article;
import com.xuesi.demoadmin.mapper.ArticleMapper;
import com.xuesi.demoadmin.service.IArticleService;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

@Service
public class ArticleServiceImpl implements IArticleService {
    @Autowired
    private ArticleMapper articleMapper;

    /**
     * 根据条件分页查询文章数据
     * 
     * @param article 文章信息
     * @return 文章列表信息
     */
    public List<Article> selectArticleList(Article article) {
        return this.articleMapper.selectArticleList(article);
    }

    /**
     * 通过文章ID查询文章
     * 
     * @param articleId 文章ID
     * @return 文章对象信息
     */
    public Article selectArticleById(Long articleId) {
        return this.articleMapper.selectArticleById(articleId);
    }

    /**
     * 新增文章信息
     * 
     * @param article 文章信息
     * @return 结果
     */
    public int insertArticle(Article article) {
        return this.articleMapper.insertArticle(article);
    }

    /**
     * 通过文章ID删除文章
     * 
     * @param article 文章对象信息
     * @return 结果
     */
    public int deleteArticleById(Article article) {
        return this.articleMapper.deleteArticleById(article);
    }
}
